/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.j;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.e.b;
import com.qihoo.gamecenter.sdk.pay.k.c;
import com.qihoo.gamecenter.sdk.pay.k.g;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class l extends d {
    private Intent b;

    public l(Context paramContext, d.a parama, Intent paramIntent) {
        super(paramContext, parama, true);
        this.b = paramIntent;
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "https://mgame.360.cn/internal/mobile_pay.json";
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        if ((j.a) && (((paramArrayOfString == null) || (paramArrayOfString.length < 13))))
            throw new IllegalArgumentException("@BankCardPay: Length of params is illegal!");
        String str1 = a(0, paramArrayOfString);
        String str2 = a(1, paramArrayOfString);
        String str3 = a(2, paramArrayOfString);
        String str4 = a(3, paramArrayOfString);
        String str5 = a(4, paramArrayOfString);
        String str6 = a(5, paramArrayOfString);
        String str7 = a(6, paramArrayOfString);
        String str8 = a(7, paramArrayOfString);
        String str9 = a(8, paramArrayOfString);
        String str10 = a(9, paramArrayOfString);
        String str11 = a(10, paramArrayOfString);
        String str12 = a(11, paramArrayOfString);
        String str13 = a(12, paramArrayOfString);
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("pay_mode", "21");
        localTreeMap.put("platform_id", "2");
        localTreeMap.put("notify_uri", this.b.getStringExtra("notify_uri"));
        localTreeMap.put("product_id", this.b.getStringExtra("product_id"));
        localTreeMap.put("product_name", this.b.getStringExtra("product_name"));
        localTreeMap.put("amount", str6);
        localTreeMap.put("app_uname", this.b.getStringExtra("app_user_name"));
        localTreeMap.put("app_uid", this.b.getStringExtra("app_user_id"));
        localTreeMap.put("app_ext1", this.b.getStringExtra("app_ext_1"));
        localTreeMap.put("app_ext2", this.b.getStringExtra("app_ext_2"));
        localTreeMap.put("user_id", this.b.getStringExtra("qihoo_user_id"));
        localTreeMap.put("sign_type", "md5");
        localTreeMap.put("sign_attr", "1");
        localTreeMap.put("bank_code", "BANK_QUICKPAY");
        localTreeMap.put("app_order_id", this.b.getStringExtra("app_order_id"));
        localTreeMap.put("access_token", this.b.getStringExtra("access_token"));
        localTreeMap.put("src", s.u(paramContext));
        localTreeMap.put("crypt_type", "rsa");
        String str14 = b.a(paramContext, str1, str2, str3, str4, str5, str7, str8, str9, str10, str11, str13);
        if (!(TextUtils.isEmpty(str14)))
            localTreeMap.put("quick_info", str14);
        String str15 = b.b(paramContext);
        if (!(TextUtils.isEmpty(str15)))
            localTreeMap.put("risk_control", str15);
        localTreeMap.put("st", g.a(str12));
        String str16 = s.a(localTreeMap, s.s(paramContext));
        c.a("OACreditCardPayTask", new Object[] { "https://mgame.360.cn/internal/mobile_pay.json", "?", str16 });
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            int i = paramJSONObject.optInt("error_code", -1);
            String str1 = paramJSONObject.optString("error");
            String str2 = paramJSONObject.optString("order_id");
            String str3 = paramJSONObject.optString("cp_param");
            int j = paramJSONObject.optInt("status", -1);
            String str4 = paramJSONObject.optString("pay_ret");
            a locala = new a();
            locala.a(i);
            locala.a(str1);
            if (locala.b()) {
                locala.b(str2);
                locala.c(str3);
                locala.b(j);
                locala.d(str4);
                a.a(locala, paramJSONObject.optInt("need_confirm_pay"));
                a.b(locala, paramJSONObject.optInt("need_send_sms"));
                a.c(locala, paramJSONObject.optInt("has_send_sms"));
                a.a(locala, paramJSONObject.optString("channel_type"));
                a.d(locala, paramJSONObject.optInt("smscodelen"));
                a.e(locala, paramJSONObject.optInt("need_card_pwd"));
                if (locala.h())
                    a.f(locala, paramJSONObject.optInt("interval", 0));
            }
            return locala;
        }
        return null;
    }

    public static class a {
        private int a;
        private String b;
        private String c;
        private String d;
        private int e = 0;
        private int f;
        private String g;
        private int h;
        private int i;
        private int j;
        private int k;
        private String l;
        private int m;

        public int a() {
            return this.e;
        }

        public boolean b() {
            return (this.a == 0);
        }

        public boolean c() {
            return (this.k != 0);
        }

        public void a(int paramInt) {
            this.a = paramInt;
        }

        public String d() {
            return this.b;
        }

        public void a(String paramString) {
            this.b = paramString;
        }

        public String e() {
            return this.c;
        }

        public void b(String paramString) {
            this.c = paramString;
        }

        public void c(String paramString) {
            this.d = paramString;
        }

        public void b(int paramInt) {
            this.f = paramInt;
        }

        public void d(String paramString) {
            this.g = paramString;
        }

        public boolean f() {
            return (this.h != 0);
        }

        public boolean g() {
            return (this.i != 0);
        }

        public boolean h() {
            return (this.j != 0);
        }

        public String i() {
            return this.l;
        }

        public int j() {
            return this.m;
        }
    }
}